Mimicing Shiny with Quarto + bslib
It was discussed in the last COCA meeting that we need some sort of static display options as an alternative to the shiny app.
An alternative display option that mimics 80% of the functionality is to blend web-based UI displays from {bslib} with some light interactivity that can be hosted as a static webpage.
Here are the components that I’m thinking of:
1. bslib for cards: these create a modern look that would be consistent with shiny. Use these to hold and frame content.
2. crosstalk + ggplot: These two packages together can add interactivity to a static page. If we’re smart about the data we need, we can mimic the shiny app functionality but keep it light.
3. Observable.js, there is also an option to build plots/tables/charts with observable for interactivity as well
Another interesting but time consuming path would be to try out observable framework: https://observablehq.com/framework/
Content Goals
The following lines are notes from Kat:
* Make a heading on the front baseline page about what this page is generally about, why am I here. Heading and two sentences
* Could not publish yet
* Could just make a mini app with two maps of change with different temp thresholds
* Be specific on what does say and doesn’t say (e.g. stock recovery status, ecological interactions)
* Explaining what a model does and doesn’t do - need a read me on the app
* Explaining biomass - better connect to habitat. Habitat suitability that support biomass or something similar. habitat potential/suitability
* Baseline and future maps probably most useful
Content Cards: bslib
bslib uses the newest bootstrap ui library to generate modern html containers for storing content. The major design element is the content “card”.
Interactive Data: crosstalk
Crosstalk adds reactivity to static pages along users to select and filter data. Brushing can also be used to highlight data across plots highlighting different dimensions of the same dataset.
Observable Interactivity
Observable.js can also be used directly to highlight data interactively without stringing along different r packages.
Actual Content:
Put actual ideas for content here.
1. Projected Environmental Change
CMIP6 scenario projections for the Northeastern US:
The chart below displays the projected change in sea surface
temperature for the Northeast US Continental Shelf Region, based
on the shared socioeconomic emissons pathway SSP5 8.5,
an ensemble climate scenario.
These climate ensembles contain estimates of temperature
and salinity conditions at monthly intervals projected
out through 2100. Estimates are
based on decades of scientific observations in the region
and projected forward using physics-based oceanographic
models. These models are then fed data on expected GHG
emissions and climate sensitivity to those emissions
unique to each SSP scenario to see how the physical environment
responds under those assumptions.
These estimates are then used to set reasonable expectations,
and test our understanding around the projected changes
to the region's environment. Differences between scenarios and
their uncertainties highlight how much/little change we
might anticipate dependent on choices made on emissions.
By taking local conditions from these ensemble climate scenarios, and plugging them into species distribution models,
scientists can begin to understand the degree to which species
may respond to changes in the physical environment under
projected climate change.
2. Baseline Conditions
Environmnetal Change History of the Northeastern US:
In the Northeast US the physical marine environment changes
at scales ranging from the hourly to decadal scales.
The marine environment is dynamic and inter-annual variation
is normal and expected regardless of climate change impacts.
By taking several decades of data to use as a baseline,
scientists can measure the degree that each variable
fluctuates naturally, and set benchmarks from which to compare against.
3. Species Preferences
Gulf of Maine Haddock Preferences Facing Projected Climates:
Haddock is an important fish species found in the cooler waters
off the Coast of New England. They serve an important role ecologically
and they support a regional fishery and commonly eaten as
fried fish fillets.
By leveraging over 50 years of NOAA Survey data,
we can learn the relationship between haddock abundance
and the temperature of the surrounding environment
where they are caught.
When we overlay the average temperatures of the
projected climate we can see whether those conditions
are more or less favorable for a species based on its
own preferences.
Species Distribution Under Observed Conditions